<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
  String _id=request.getParameter("_");
  request.setAttribute("now",new Date());
%>

<div class="row">
    <div class="col-lg-12">
        <div class="panel">
            <div class="panel-heading">
                <h3 class="panel-title">资产报废登记表</h3>
            </div>

            <!-- BASIC FORM ELEMENTS -->
            <!--===================================================-->
            <form id="form_assetscrap_input" class="panel-body form-horizontal form-padding">
                <input type="hidden" name="keyId" id="keyId" value="${assetScrap.id}" />

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        资产名称
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="text" id="name" name="name" class="form-control" value="${assetScrap.name}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">资产编号<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="assetNo" name="assetNo" class="form-control" value="${assetScrap.asset.assetNo}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">规则型号<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="model" name="model" class="form-control" value="${assetScrap.asset.model}" disabled>
                    </div>
                </div>

                <div class="form-group div-Hidden">
                    <label class="col-md-2 control-label">采购日期<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <div class="input-group date">
                            <input type="text" class="form-control" id="datPurchase" name="datPurchase" disabled
                                   value=<fmt:formatDate pattern="yyyy-MM-dd" value="${assetScrap.asset.datPurchase}" /> >
                            <span class="input-group-addon"><i class="ti-calendar"></i></span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">采购金额<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="number" id="purchaseMoney" name="purchaseMoney" class="form-control" value="${assetScrap.asset.purchaseMoney}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">报废原因<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="dictItem" name="dictItem" class="form-control" value="${assetScrap.dictItem.name}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        已提折旧（元）
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="number" id="numYTZJMoney" name="numYTZJMoney" class="form-control" readonly value="${assetScrap.numYTZJMoney}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        净值（元）
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="number" id="numNetMoney" name="numNetMoney" class="form-control" readonly value="${assetScrap.numNetMoney}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        残值（元）
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="number" id="numLeftMoney" name="numLeftMoney" class="form-control" readonly value="${assetScrap.numLeftMoney}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">相关附件</label>
                    <div class="col-md-6">
                        <input name="hiddenFiles" id="hiddenFilesAttachment" type="hidden" value="${assetScrap.fileAttachment}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">提交人</label>
                    <div class="col-md-2">
                        <p class="form-control-static">${assetScrap.creater.name}</p>
                    </div>
                    <label class="col-md-2 control-label">提交日期</label>
                    <div class="col-md-2">
                        <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${assetScrap.dateApply}" /></p>
                    </div>
                </div>

            </form>
            <!--===================================================-->
            <!-- END BASIC FORM ELEMENTS -->

            <div class="panel-footer">
                <a class="btn btn-default" id="apply-re-common" href="javascript:void(0)">
                    <i class="fa fa-lg fa-mail-reply"></i> 返回视图
                </a>
                <c:if test="${assetScrap.numStatus==0}">
                    <a class="btn btn-warning" key="ajax_assetscrap_edit" href="javascript:void(0);"><i class="fa fa-lg fa-edit"></i> 编辑表单 </a>
                </c:if>
            </div>

        </div>
    </div>
</div>

<script>

    // 附件显示
    readLoad({
        objId:"hiddenFilesAttachment",
        entityName:"fileAttachment",
        sourceId:"hiddenFilesAttachment"
    });

    //编辑
    $("a[key='ajax_assetscrap_edit']").unbind("click").bind("click",function(){
        loadURL("<%=path%>/activiti/assetscrap/edit/"+$("#keyId").val(),$('#page-content'));
    });

    //返回视图
    $("#apply-re-common").click(returnToHashUrl);

    // 加载完成后执行
    $(function(){
       

    })

</script>
